package com.hmsm.sys.action;

import javax.annotation.Resource;

import com.hmsm.server.base.BaseAction;
import com.hmsm.sys.controller.PurviewController;
import com.hmsm.sys.po.UserInfo;
import com.lzyyj.common.Page;
import com.lzyyj.gmis.base.model.Purview;

@SuppressWarnings("serial")
public class PurviewAction extends BaseAction<UserInfo> {
	
	@Resource
	private PurviewController purviewController;

	public PurviewController getPurviewController() {
		return purviewController;
	}

	private Page<Purview> page = new Page<Purview>();
	
	public Page<Purview> getPage() {
		return page;
	}

	public void setPage(Page<Purview> page) {
		this.page = page;
	}
	
	private Purview item;

	public Purview getItem() {
		return item;
	}

	public void setItem(Purview item) {
		this.item = item;
	}

	public String manage(){
		page = getRoleInfoService().purviewManage(page, getSessionUser());
		return SUCCESS;
	}
	
	public String del(){
		UserInfo currentUser = getSessionUser();
		
		mapResult = getPurviewController().del(item, currentUser);
		return "json";
	}
	
	public String save(){
		UserInfo currentUser = getSessionUser();
		
		mapResult = getPurviewController().save(item, currentUser);
		
		return "json";
	}
	
}
